Skip to content

test: fix Session tests execution in random order#10370

Open
gr8man wants to merge 3 commits into
codeigniter4:developfrom
gr8man:fix-session-tests-random-order
Open

test: fix Session tests execution in random order#10370
gr8man wants to merge 3 commits into
codeigniter4:developfrom
gr8man:fix-session-tests-random-order

Conversation

@gr8man

@gr8man gr8man commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description
Ref: #9968

This PR moves the markTestSkipped logic earlier in the setup phase for session tests. By checking the skip conditions before the database is initialized, we avoid unnecessary setup operations and improve test execution speed.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@github-actions github-actions Bot added the testing Pull requests that changes tests only label Jul 2, 2026

@michalsn michalsn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code change itself looks fine, but the PR description and title should be corrected.

Moving the skip earlier avoids unnecessary DB setup... however, the claim that tearDown() is never executed is inaccurate, and tearDownDatabase() is not responsible for rolling back migrations anyway. So this is more of a cleanup/refactor that prevents unnecessary database initialization for skipped tests, rather than a fix for missing teardown cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Pull requests that changes tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants